package com.xxx.user.api;

import com.xxx.common.base.bo.ListResult;
import com.xxx.user.dto.*;
import com.xxx.user.service.UserService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@AllArgsConstructor
public class UserApiImpl implements UserApi {

    private final UserService userService;

    @Override
    public String create(@RequestBody UserCreateReqDTO param) {
        return userService.create(param);
    }

    @Override
    public String update(@RequestBody UserUpdateReqDTO param) {
        return userService.update(param);
    }

    @Override
    public String delete(@RequestBody List<Long> ids) {
        return userService.delete(ids);
    }

    @Override
    public ListResult<UserGetAllResDTO> getAll(@SpringQueryMap UserGetAllReqDTO param) {
        return userService.getAll(param);
    }

    @Override
    public String login(@RequestBody UserDoLoginReqDTO param) {
        return userService.login(param);
    }

}
